package com.xigua.JucOfBeautiful.chapterOne.join1_4;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/1/2222:19
 */
public class JoinTest {
    public static void main(String[] args) throws InterruptedException {
        Thread threadOne = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("threadOne over");
        });

        Thread threadTow = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("threadTow over");
        });

        threadOne.start();
        threadTow.start();
        System.out.println("wait all child thread over");
        threadOne.join();
        threadTow.join();
        System.out.println("all child thread over");


    }
}
